m() {
    mkdir -p $@ && cd $1
}

c() {
    cd "$*" && ls 
}

fswap() {
    mv $1 /tmp/`basename $1`.backup &&
    mv $2 $1 &&
    mv /tmp/`basename $1`.backup $2
}

origit() {
    for file in $@
        do
            test -e "$file" && /bin/cp -vr "$file" "$file.orig"
        done
}

nth() {
    awk "{print \$$1}"
}

if ! systemd-notify --booted; then  # not using systemd
  start() {
    sudo rc.d start $1
  }

  restart() {
    sudo rc.d restart $1
  }

  stop() {
    sudo rc.d stop $1
  }
else
  start() {
    sudo systemctl start $1.service
  }

  restart() {
    sudo systemctl restart $1.service
  }

  stop() {
    sudo systemctl stop $1.service
  }

  enable() {
    sudo systemctl enable $1.service
  }

  status() {
    sudo systemctl status $1.service
  }

  disable() {
    sudo systemctl disable $1.service
  }
fi

